/*   1:    */ package com.rinsi.app.azsb.azzl.scs.scxkz;
/*   2:    */ 
/*   3:    */ import com.rinsi.core.CoreCache;
/*   4:    */ import com.rinsi.core.service.CoreSimpleService;
/*   5:    */ import com.rinsi.util.FormaterUtil;
/*   6:    */ import com.rinsi.util.ListUtil;
/*   7:    */ import com.rinsi.util.MapUtil;
/*   8:    */ import java.util.Date;
/*   9:    */ import java.util.List;
/*  10:    */ import java.util.Map;
/*  11:    */ import org.mybatis.spring.SqlSessionTemplate;
/*  12:    */ import org.springframework.stereotype.Service;
/*  13:    */ 
/*  14:    */ @Service
/*  15:    */ public class ScxkzService
/*  16:    */   extends CoreSimpleService
/*  17:    */ {
/*  18:    */   public void afterIndex(Map<String, Object> model, Map<String, Object> rMap)
/*  19:    */   {
/*  20: 23 */     Map<String, Object> params = getParams(model);
/*  21:    */     
/*  22: 25 */     Map<String, Object> config = getConfig(model);
/*  23:    */     
/*  24: 27 */     rMap.put("jjlxs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400002)));
/*  25:    */     
/*  26: 29 */     List<Map<String, Object>> modules = CoreCache.getCacheList(MapUtil.getString(params, "UID"), "modules");
/*  27:    */     
/*  28: 31 */     List<Map<String, Object>> sub_rights = ListUtil.subList(modules, "MODULE_NO_PRE='500005'");
/*  29:    */     
/*  30: 33 */     rMap.put("azsbxx", getSqlSessionTemplate().selectOne("azsb.get", params));
/*  31:    */     
/*  32: 35 */     rMap.put("userxx", CoreCache.getCacheMap(MapUtil.getString(params, "UID"), "user"));
/*  33:    */     
/*  34: 37 */     model.put("sub_rights", ListUtil.listToMap(sub_rights, "MODULE_TYPE"));
/*  35:    */     
/*  36: 39 */     rMap.put("organxx", CoreCache.getCacheMap(MapUtil.getString(params, "UID"), "organ"));
/*  37:    */     try
/*  38:    */     {
/*  39: 43 */       List<Map<String, Object>> datas = getSqlSessionTemplate().selectList(namespace(config) + ".list", params);
/*  40:    */       
/*  41: 45 */       rMap.put("datas", datas);
/*  42:    */       
/*  43: 47 */       rMap.put("success", Boolean.valueOf(true));
/*  44:    */     }
/*  45:    */     catch (Exception e)
/*  46:    */     {
/*  47: 51 */       rMap.put("success", Boolean.valueOf(false));
/*  48: 53 */       if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/*  49: 55 */         rMap.put("message", e.getMessage());
/*  50:    */       } else {
/*  51: 59 */         rMap.put("message", "展示数据列表出错！请稍后重试，或联系系统管理员！");
/*  52:    */       }
/*  53: 62 */       rMap.put("ex", e.getMessage());
/*  54:    */       
/*  55: 64 */       e.printStackTrace();
/*  56:    */     }
/*  57:    */   }
/*  58:    */   
/*  59:    */   public Map<String, Object> scbxx(Map<String, Object> model)
/*  60:    */   {
/*  61: 72 */     Map<String, Object> params = getParams(model);
/*  62:    */     
/*  63: 74 */     Map<String, Object> config = getConfig(model);
/*  64:    */     
/*  65: 76 */     Map<String, Object> rMap = getRMap();
/*  66:    */     try
/*  67:    */     {
/*  68: 80 */       int scbxxNum = ((Integer)getSqlSessionTemplate().selectOne(namespace(config) + ".scbxx", params)).intValue();
/*  69: 82 */       if (scbxxNum != 0) {
/*  70: 84 */         throw new Exception("请填写所有审查表信息！");
/*  71:    */       }
/*  72: 88 */       rMap.put("success", Boolean.valueOf(true));
/*  73:    */     }
/*  74:    */     catch (Exception e)
/*  75:    */     {
/*  76: 92 */       rMap.put("success", Boolean.valueOf(false));
/*  77:    */       
/*  78: 94 */       rMap.put("message", e.getMessage());
/*  79:    */       
/*  80: 96 */       rMap.put("ex", e.getMessage());
/*  81:    */       
/*  82: 98 */       e.printStackTrace();
/*  83:    */     }
/*  84:102 */     return rMap;
/*  85:    */   }
/*  86:    */   
/*  87:    */   public void afeterUpdate(Map<String, Object> model, Map<String, Object> rMap)
/*  88:    */   {
/*  89:109 */     Map<String, Object> params = getParams(model);
/*  90:    */     
/*  91:111 */     Map<String, Object> config = getConfig(model);
/*  92:    */     
/*  93:113 */     Map<String, Object> azsbXx = (Map)getSqlSessionTemplate().selectOne(namespace(config) + ".checkSbzt", params);
/*  94:115 */     if ((Integer.parseInt(azsbXx.get("SJZT").toString()) == 9) && (Integer.parseInt(azsbXx.get("AZSB_DQHJ").toString()) == 4))
/*  95:    */     {
/*  96:117 */       params.put("GGXX_NAME", "关于" + azsbXx.get("KJJBXX_KJMC") + "煤矿的安全许可证颁发公告！");
/*  97:    */       
/*  98:119 */       params.put("GGXX_REMARK", "我局于" + FormaterUtil.formatDateValue(new Date()) + "向" + azsbXx.get("KJJBXX_KJMC") + "颁发煤矿安全生产许可证！特此通知。");
/*  99:    */       
/* 100:121 */       params.put("GGXX_TYPE", "1");
/* 101:    */       
/* 102:123 */       getSqlSessionTemplate().insert(namespace(config) + ".addGg", params);
/* 103:    */     }
/* 104:    */   }
/* 105:    */ }


/* Location:           D:\Users\Desktop\shanxi\项目\sxazmis\WEB-INF\classes\
 * Qualified Name:     com.rinsi.app.azsb.azzl.scs.scxkz.ScxkzService
 * JD-Core Version:    0.7.0.1
 */